package com.qk.management.task;

import com.qk.management.service.impl.GarbageCleanupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class GarbageCleanupTask {

    @Autowired
    private GarbageCleanupService cleanupService;

    // 每天凌晨 2 点执行
    @Scheduled(cron =  "0 0 */2 * * ?")
    public void execute() {
        cleanupService.cleanGarbageFiles();
    }
}
